// index.js
let pendingCateMode = null;
Page({
  data: {
    recommendList: [
      { img: '/pages/images/coffee001.jpg', name: '气泡美式', price: 26 },
      { img: '/pages/images/coffee002.jpg', name: '美式咖啡', price: 10 },
      { img: '/pages/images/coffee003.jpeg', name: '卡布奇诺', price: 20 },
      { img: '/pages/images/exhibit01.jpeg', name: '日月星辰', price: 32 },
      { img: '/pages/images/exhibit02.jpeg', name: '雪落海滨', price: 35 }
    ]
  },
  goToCateSelf() {
    pendingCateMode = 0;
    wx.switchTab({ url: '/pages/cate/index' });
  },
  goToCateDelivery() {
    pendingCateMode = 1;
    wx.switchTab({ url: '/pages/cate/index' });
  },
  goToVipCode() {
    wx.navigateTo({ url: '/pages/vipcode/index' });
  },
  goToVipCenter() {
    wx.navigateTo({ url: '/pages/vipcenter/index' });
  },
  goToCouponCenter() {
    wx.navigateTo({ url: '/pages/couponcenter/index' });
  },
  goToMall() {
    wx.navigateTo({ url: '/pages/mall/index' });
  },
  goToLuck() {
    wx.navigateTo({ url: '/pages/luck/index' });
  },
  // 提供给点单页读取的静态方法
  getPendingCateMode() {
    return pendingCateMode;
  },
  clearPendingCateMode() {
    pendingCateMode = null;
  }
});
